<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>

    function Fn() {
        console.log(this)
        if (this.constructor === Fn) {
            console.log('构造函数调用')
            this.x = 10
            this.y = 20
        } else if (this === window) {
            console.log('普通函数调用')
        }
        // return new Object({a:1,b:2})
        // return 'hello'
    }
    Fn.prototype._toString = function () {
        return `(${this.x},${this.y})`
    }
    var res = new Fn()
    var ress = res._toString()
    console.log(res, ress)





</script>

</html>